<script type="text/javascript" src="<?php echo tos_cdn_url('js/color_table.js');?>"></script>
<script type="text/javascript">
var font_color_table = new z.color_table({wrap:z.s('font_color_table_wrap')});
var bg_color_table = new z.color_table({wrap:z.s('bg_color_table_wrap')});
var node_caption = z.s('node_caption');
var color_picker = z.s('color_picker');

font_color_table.on_select_color = function (rgb) {
    node_caption.style.color = rgb.s;
    //node_caption.focus();
};
bg_color_table.on_select_color = function (rgb) {
    node_caption.style.backgroundColor = rgb.s;
    //node_caption.focus();
};



function change_url_segment(target) {
    var caption = target.value;
    var query = z.query_encode(caption);
    z.s('node_query').innerHTML = query;
}
function sh_color_picker() {
    if (color_picker.style.display != 'block') {
        color_picker.style.display = 'block';
    } else {
        color_picker.style.display = 'none';
    }
    return false;
}
/*
function show_color_picker() {
    color_picker.style.display = 'block';
    abort_blur = false;
}
function hide_color_picker() {
    if ( ! abort_blur) {
        color_picker.style.display = 'none';
    }
    abort_blur = false;
}*/
</script>